from fontTools.ttLib import TTFont
import requests

html=requests.get('https://www.shixiseng.com/interns/iconfonts/file?rand=0.32572009023637016')
with open('file','wb')as f:
    f.write(html.content)

font=TTFont("./file")
font.saveXML('file.xml')

bestcmap=font['cmap'].getBestCmap()
#print(bestcmap)
newDict={}
for k,v in bestcmap.items():
    if v=='x':
        continue

    v=v.replace('uni','')
    if len(v) < 4:
        v=('\\u00' + v).encode('utf-8').decode('unicode_escape')
        newDict[hex(k)] = v
    else:
        v=('\\u' + v).encode('utf-8').decode('unicode_escape')
        newDict[hex(k)]= v
#
print(newDict)